<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/"; 
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
<base href="<%=basePath%>">
		<title>商品详情</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
<style type="text/css">
.div1{ padding:10px 5px 15px 40px;word-wrap: break-word;word-break:break-all;} 
font.font_span{
font-weight: bold; font-size: large;
}

	#sub{
		cursor: pointer;
		flaot:left;
		border:1px solid gray;
		width:10px;
		height:18px;
		padding:0px;
	}
	
	#add{
		cursor: pointer;
		flaot:left;
		border:1px solid gray;
		width:10px;
		height:18px;
		padding:0px;
	}

.content1 {
min-width: 400px;
position: relative;
min-height: 650px;
background: #fff;
margin-left: 240px;
margin-top: 6px;
}
</style>
<script type="text/javascript">
	function add() {
		var num = parseInt(document.getElementById("number").value);
		if (num < 100) {
			document.getElementById("number").value = ++num;
		}
	}

	function sub() {
		var num = parseInt(document.getElementById("number").value);
		if (num > 1) {
			document.getElementById("number").value = --num;
		}
	}
</script>

	</head>

	<body>
	<jsp:include page="../userview/top.jsp"></jsp:include>
		<!-- 内容开始 -->
		<div class="content1"  >
			<div class="header">
				<h1 class="page-title">
					菜谱
				</h1>
			</div>

			<ul class="breadcrumb">
				<li>
					<a href="/WirelessOrder/home.do?flag=home">主页</a>
					<span class="divider">/</span>
				</li>
				<li class="active">
					菜谱
				</li>
			</ul>
		<ul class="nav nav-tabs">
			<li class="active">
				<a href="#home" data-toggle="tab">菜谱详情</a>
			</li>
			<li>
				<a href="#profile" data-toggle="tab">留言评价</a>
			</li>
		</ul>
		<div id="myTabContent" class="tab-content">
		<div class="tab-pane active in" id="home">
		<s:iterator value="#session.list" var="item">
			<s:form action="insert" theme="simple">
				<div class="container-fluid">
					<div class="row-fluid">
						<div class="row-fluid">
							<div class="span1"></div>
							<div class="span5">
								<h1>
									<s:property value="%{#request.itemName}" />
								</h1>
								<img src="<s:property value="%{#request.itemPicture}"/>" alt=""
									width="220" height="170">
							</div>
							<div class="span6">
								<h2>
									<span class="label"> 价 格 : </span>
									<span class="label label-success"> <s:property
											value="%{#request.itemPrice}" />
									</span>
								</h2>
								<h2>
									<span class="label"> 类 型 : </span>
								</h2>
								<span class="label label-success"> <s:property
										value="%{#request.itemTypename}" />
								</span>
								<h2>
									<span class="label"> 备 注 : </span>
								</h2>
								<p class="text-success">
									<s:property value="%{#request.itemDescription}" />
								</p>

								<div id="nm" style="white-space: nowrap;margin-bottom:10px;">

									<span class="label"> 商品数量: </span>

									<span id="sub" onClick="sub();">&nbsp;-&nbsp;</span>
									<s:textfield name="cart.count"
										style="font-size:12px;width:35px;cursor:default;margin-bottom:0px;text-align:center;" value="1" id="number"
										onkeyup="if(!/^([1-9]|[1-9][0-9]|100)$/.test(this.value)){alert('请输入1-100的整数')} this.value=this.value.replace(/\D/g,'')" 
										onafterpaste="if(!/^([1-9]|[1-9][0-9]|100)$/.test(this.value)){alert('请输入1-100的整数')} this.value=this.value.replace(/\D/g,'')"
										/>
									<span id="add" onClick="add();" style="cursor: pointer;">&nbsp;+&nbsp;</span>
								</div>

									<button class="btn btn-success" type="submit" onclick="">
									加入购物车
								</button>
								<a href="cartInfo"><button class="btn btn-primary"
										type="button">
										查看购物车
									</button>
								</a>
							</div>

						</div>
						<div class="form-actions"  >

							<a href="javascript:history.back();" > <input
									type="button" class="btn" value="返  回"> </a>
						</div>
					</div>
					<!-- 内容结束 -->


					<s:hidden name="cart.itemId" label="餐饮编号"
						value="%{#request.itemId}" readonly="true" />
					<br>
					<s:hidden name="cart.itemName" label="餐饮名称"
						value="%{#request.itemName}" />
					<br>
					<s:hidden name="cart.itemPrice" label="价格"
						value="%{#request.itemPrice}" />
					<br>
					<s:hidden name="cart.itemDescription" label="描述"
						value="%{#request.itemDescription}" />
					<s:hidden name="cart.itemType" label="类别"
						value="%{#request.itemType}" />
					<s:hidden name="cart.itemNum" label="库存"
						value="%{#request.itemNum}" />
					<br>
					<s:hidden name="cart.shopId" label="商店编号"
						value="%{#request.store.shopId}" />
					<br>
			</s:form>
		</s:iterator>
		</div></div>
			<div class="tab-pane fade" id="profile">
				<div class="row-fluid">
			
				
		<div class="span12">
			<div class="row-fluid">
			
				<div class="span3 div1" >
				<font class="font_span">普通用户</font>
				</div>
				<div class="span6 div1" >
				<font class="font_span">评论内容</font>
				</div>
				<div class="span3 div1" >
				<font class="font_span">评论时间</font>
				</div>
			
			</div>
			<s:iterator value="allreceipt" status="st">
			
			<hr>
			<div class="row-fluid">
			
				<div class="span3 div1" padding:10px 5px 15px 20px;>
				
				
				用户：<s:property value="userName" />
				
				<s:if test='%{#session.loginUser.userName == userName}'>
				<a href="deletereceiptAction?receiptId=<s:property value="receiptId" />">删除</a>
				</s:if>
				</div>
				<div class="span6 div1" >
				<s:property value="matter"/>
				</div>
				<div class="span3 div1" >
				<s:date name="postTime" format="yyyy-MM-dd HH:mm:ss" />
				</div>
			
			</div>
			<hr>
			</s:iterator>
			<div class="pagination">
							<ul>
								<li>
									
									<a class="maroon" href="getItem.action?pageNumber=1">首页</a>
									<a class="maroon"
										href="getItem.action?pageNumber=<s:property value="pageNumber-1"/>">上一页</a>
									<a class="maroon"
										href="getItem.action?pageNumber=<s:property value="pageNumber+1"/>">下一页</a>
									<a class="maroon"
										href="getItem.action?pageNumber=<s:property value="totalPage"/>">末页</a>
								<s:property value="pageNumber" />
									/
									<s:property value="totalPage" />
								</li>
							</ul>
						</div>
			<div class="row-fluid">
				<form action="/sell_food/AddreceiptAction" method="post">
				<div class="span12 div1" >
				<s:textarea  name="matter" rows="2" cols="50" style="margin: 0px 10px 0px 10px; width: 95%; height: 100px;"></s:textarea>
				</div>
				<center><button class="btn btn-primary"
										type="submit">
										提交评价
									</button></center>
				</form>
			</div>
		</div>
	</div>
			</div>
		</div>

	</body>
</html>
